package com.project.bean;

import com.project.valid.AddValid;
import com.project.valid.UpdateValid;

import javax.validation.constraints.Pattern;

/**
 * 供应商实体类
 */
public class SuppliersBean {
    private int id;//主键id
    @Pattern(groups = AddValid.class,regexp = "[a-zA-Z\\u4e00-\\u9fa5]{2,}",message = "名称必须是两位以上汉字或字母")
    private String name;//供应商名称
    @Pattern(groups = {AddValid.class, UpdateValid.class},regexp = "[a-zA-Z\\u4e00-\\u9fa5]{2,}",message = "负责人名称必须是两位以上汉字或字母")
    private String headMan; //供应商负责人
    @Pattern(groups = AddValid.class,regexp = "\\S{4,}",message = "经营范围必须是四位以上汉字或字母")
    private String scope;//供应商经营范围
    @Pattern(groups = {AddValid.class, UpdateValid.class},regexp = "1[38579]\\d{9}",message = "电话号码必须是1开头的11位数字")
    private String tel;//供应商电话
    @Pattern(groups = AddValid.class,regexp = "[0-9a-zA-Z\\u4e00-\\u9fa5]{4,}",message = "供应商地址必须详细填写")
    private String address;//供应商地址

    public SuppliersBean() {
    }

    public SuppliersBean(String name, String headMan, String scope, String tel, String address) {
        this.name = name;
        this.headMan = headMan;
        this.scope = scope;
        this.tel = tel;
        this.address = address;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getHeadMan() {
        return headMan;
    }

    public void setHeadMan(String headMan) {
        this.headMan = headMan;
    }

    public String getScope() {
        return scope;
    }

    public void setScope(String scope) {
        this.scope = scope;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public String toString() {
        return "SuppliersBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", headMan='" + headMan + '\'' +
                ", scope='" + scope + '\'' +
                ", tel='" + tel + '\'' +
                ", address='" + address + '\'' +
                '}';
    }
}
